package org.example.sdk;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class ResourceService {

    @Autowired
    private ResourceRepositoryManager resourceRepositoryManager;

    public <T> FindResult<T> find(String resource, Query query) {
        ResourceRepository<T> repository = resourceRepositoryManager.getResourceRepository(resource);
        return repository.find(query);
    }

}
